const { Sequelize } = require('sequelize');
const { DATABASE_HOST, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME } = require('../utils/dot');
// 方法 3: 分别传递参数 (其它数据库)
const seq = new Sequelize(DATABASE_NAME, DATABASE_USER,DATABASE_PASSWORD, {
    host: DATABASE_HOST,
    dialect: 'mysql',
    timezone: "+08:00",
});

seq.authenticate().then((e) => {
    console.log('数据库连接成功');
}).catch((err) => {
    console.log('数据库连接失败'+err);
});
module.exports = seq;